﻿@using System.Web.Mvc
@using System.Web.Mvc.Html

@helper Script(WebViewPage page, params string[] paths)
{
    foreach (var path in paths)
    {
        <script src="@page.Url.Content(path)" type="text/javascript"></script>
    }
}

@helper Css(WebViewPage page, params string[] paths)
{
    foreach (var path in paths)
    {
        <link href="@page.Url.Content(path)" rel="stylesheet" type="text/css" media="all" />
    }
}

@helper Navbar(string activeId, WebViewPage page)
    { 
    <div class="navbar navbar-fixed-top">
        <div class="navbar-inner">
            <div class="offset05">
                <a class="brand" href="http://petrsu.ru">ПетрГУ</a>
                <ul class="nav">
                    <li id="scheduleGroupLink" @if (activeId == "scheduleWizardLink")
                                               { @page.Html.Raw("class=\"active\"") } >
                        <a href="@page.Url.Action("Index")">Создать расписание</a>
                    </li>
                    <li id="scheduleGroupLink" @if (activeId == "scheduleGroupLink")
                                               { @page.Html.Raw("class=\"active\"") } >
                        <a href="@page.Url.Action("Group")">Расписание групп</a>
                    </li>
                    <li id="scheduleAuditoriumLink" @if (activeId == "scheduleAuditoriumLink")
                                                    { @page.Html.Raw("class=\"active\"") } >
                        <a href="@page.Url.Action("Auditorium")">Расписание аудиторий</a>
                    </li>
                    <li id="scheduleLecturerLink" @if (activeId == "scheduleLecturerLink")
                                                  { @page.Html.Raw("class=\"active\"") } >
                        <a href="@page.Url.Action("Lecturer")">Расписание преподавателей</a>
                    </li>
                    <li id="scheduleLecturerLink" @if (activeId == "scheduleInforForScheduleLink")
                                                  { @page.Html.Raw("class=\"active\"") } >
                        <a href="@page.Url.Action("InfoForSchedule")">Сведения к расписанию</a>
                    </li>

                </ul>
            </div>
            <div class="status" data-bind="visible: isLoading">
                <span class="spinner"></span>​ Загрузка данных...
            </div>
            <div class="right">
                <ul class="nav nav-pills pull-right">
                    <li class="dropdown" id="menu1">
                        <a class="dropdown-toggle" role="menu" data-toggle="dropdown" href="#menu1">Test user   <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">@Resources.Message.Settings</a></li>
                            <li class="divider"></li>
                            <li>
                                <a href="@page.Url.Action("SignOut")">@Resources.Message.Exit</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </div>
}

@helper Toolbar(string classes ="", bool showCalendarTool = true, bool showCrudTool = true, Action action = null)
{
<div class="actions @classes" style="height: 50px;">
    <div class="row" style="margin-left: 0px;">
        <div class="span10" style="margin-left: 0px;">
            <div class="btn-toolbar">
                @if (showCalendarTool) { 
                <div class="btn-group">
                    <a class="btn btn-info" href="#" rel="tooltip" data-original-title="Перейти на неделю назад" data-bind="click: backWeek"><</a> 
                    <a class="btn btn-info" href="#" rel="tooltip" data-original-title="Перейти к текущей неделе" data-bind="click: todayWeek">Сегодня</a> 
                    <a class="btn btn-info" href="#" rel="tooltip" data-original-title="Перейти на неделю вперед" data-bind="click: forwardWeek">></a>
                </div>    
                }
                @if (showCrudTool) { 
                <div class="btn-group">
                    <a class="btn btn-success" href="#" rel="tooltip" data-original-title="Запланировать новое занятие" data-bind="click: addLessonView">Добавить</a> 
                    <a class="btn btn-warning" href="#" rel="tooltip" data-original-title="Внести корректировки в занятие" data-bind="click: editLessonView, css: { 'disabled': selectedScheduleCard() === undefined }">Редактировать</a> 
                    <a class="btn btn-danger" href="#" rel="tooltip" data-original-title="Отменить занятие" data-bind="click: deleteLessonView, css: { 'disabled': selectedScheduleCard() === undefined }">Удалить</a>
                </div>
                }
                @if (action != null) { action(); }
            </div>
        </div>
    </div>
</div>
}

@helper SearchTextBox(string placeholder, string inputValueTarget, string searchButtonClick)
    {
    <div class="input-append">
        <input class="span3" size="16" id="searchTextBox" type="text" data-original-title="@placeholder" rel="tooltip" data-bind="value: @inputValueTarget"><button class="btn btn-info" type="button" data-bind="click: @searchButtonClick">Найти</button>
    </div>
}

